MuleSoft Accelerator for Retail icon

MuleSoft Accelerator for Retail

(0 reviews)

SAP custom BAPI setup guide - customer profile sync

The following provides guidance on how to use the custom BAPI code (e.g., ZBAPI_CUSTOMER_V3) for your SAP instance.

Important: You must complete the following instructions before proceeding to Use case 1 - Customer profile sync from SAP.

BAPI custom objects

You must create the following ABAP objects in order to use this custom BAPI, which are described below.

Data elements

  • Z_MASTER_ID

Structures

  • ZSTR_PERSON
  • ZSTR_ORGANIZATION
  • ZSTR_GROUP
  • ZES_CUSTOMER
  • ZES_CONTROLDATA

Table types

  • ZTY_CUSTOMER

Transparent tables

  • ZTT_CUSTOMER

Function groups

  • ZFG_CUSTOMER
  • ZFG_CUSTOMER2

Function modules

ZBAPI_CUSTOMER modules

  • ZBAPI_CUSTOMER
  • ZBAPI_CUSTOMER_CREATE
  • ZBAPI_CUSTOMER_CUSTOM_FIELDS
  • ZBAPI_CUSTOMER_UPDATE

More ZBAPI modules

  • ZBAPI_QUERY
  • ZBAPI_ADDR_QUERY
  • ZBAPI_QUERY_SAP
  • ZBAPI_CUST_QUERY
  • ZBAPI_CUSTOMER_CD

Creating data elements

ObjectHow to create
Z_MASTER_IDsfc-retail-com-bapi_01.png

Creating structures

ObjectHow to create
ZSTR_PERSONretail-2.2-bapi-01.1.png
ZSTR_ORGANIZATIONretail-2.2-bapi-01.2.png
ZSTR_GROUPretail-2.2-bapi-01.3.png
ZES_CUSTOMERretail-2.2-bapi-01.4.png
ZES_CONTROLDATAretail-2.2-bapi-01.5.png

Creating table types

ObjectHow to create
ZTY_CUSTOMERsfc-retail-com-bapi_05.png

Creating transparent tables

ObjectHow to create
ZTT_CUSTOMERretail-2.2-bapi-05.1.png



back to top

Creating function groups and function modules

ZBAPI Customer modules
  1. Create the function group "ZFG_CUSTOMER_V3".

  2. Create the function module "ZBAPI_CUSTOMER_V3", using "Remote-enable module" as processing type:

    sfc-retail-com-bapi_06.png

  3. Complete the import parameters with the following:

    sfc-retail-com-bapi_07.png

  4. Complete the export parameters with the following:

    sfc-retail-com-bapi_08.png

  5. Copy and paste the code from "ZBAPI_CUSTOMER_V3.txt".

  6. Create the function module "ZBAPI_CUSTOMER_CREATE_V3":

    sfc-retail-com-bapi_09.png

  7. Complete the import parameters with the following:

    retail-2.2-bapi-09.1.png

  8. Complete the export parameters with the following:

    sfc-retail-com-bapi_11.png

  9. Copy and paste the code from "ZBAPI_CUSTOMER_CREATE_V3.txt".

  10. Create the function module "ZBAPI_CUSTOMER_CUSTOM_FLDS_V3":

    sfc-retail-com-bapi_15.png

  11. Complete the import parameters with the following:

    retail-2.2-bapi-15.1.png

  12. Copy and paste the code from "ZBAPI_CUSTOMER_CUSTOM_FIELDS_V3.txt".

  13. Create the function module "ZBAPI_CUSTOMER_UPDATE_V3":

    sfc-retail-com-bapi_12.png

  14. Complete the import parameters with the following:

    retail-2.2-bapi-12.1.png

  15. Complete the export parameters with the following:

    retail-2.2-bapi-12.2.png

  16. Copy and paste the code from "ZBAPI_CUSTOMER_UPDATE_V3.txt".

  17. Create the function module "ZBAPI_QUERY_V3", using "Remote-enable module" as processing type:

    sfc-retail-com-bapi_36.png

  18. Complete the import parameters with the following:

    retail-2.2-bapi-36.1.png

  19. Complete the export parameters with the following:

    sfc-retail-com-bapi_22.png

  20. Copy and paste the code from "ZBAPI_QUERY_V3.txt".

  21. Create the function module "ZBAPI_CONTROL_DATA_V3":

    sfc-retail-com-bapi_21.png

  22. Complete the import parameters with the following:

    sfc-retail-com-bapi_24.png

  23. Complete the export parameters with the following:

    sfc-retail-com-bapi_19.png

  24. Copy the source code from "ZBAPI_CONTROL_DATA_V3.txt".

  25. Activate the entire function group by right-clicking on it in the tree and then selecting "Activate":

    sfc-retail-com-bapi_35.png

  26. Create the function group "ZFG_CUSTOMER2".

  27. Create the function module "ZBAPI_ADDR_QUERY", using "Remote-enable module" as processing type:

    sfc-retail-com-bapi_17.png

  28. Complete the import parameters with the following:

    sfc-retail-com-bapi_20.png

  29. Complete the export parameters with the following:

    sfc-retail-com-bapi_22.png

  30. Copy and paste the code from "ZBAPI_ADDR_QUERY.txt".

  31. Create the function module "ZBAPI_CONTROL_DATA" using the import parameters as follows:

    retail-2.2-bapi-22.1.png

  32. Use the export parameters as in the following:

    retail-2.2-bapi-22.2.png

  33. Copy the source code from "ZBAPI_CONTROL_DATA.txt".

  34. Activate the entire function group by right-clicking on it in the tree and selecting 'Activate':

    retail-2.2-bapi-22.3.png

  35. Complete the following:
    1. Create a customer group ZSME (Logistics - General->Business Partner->Customer->Control->Define and Assign Customer Number Ranges)
    2. Create a partner group ZSME (Cross-Application Components->SAP Business Partner->Business Partner->Basic Settings->Number Ranges and Settings) from the transaction SPRO
    3. Synchronize them from the same transaction (Cross-Application Components->Master Data Synchronization->Customer/Vendor Integration->Business Partner Settings->Settings for Customer Integration->Assign Keys->Define Number Assignment for Direction BP to Customer)

      retail-2.2-bapi-22.4.png



back to top

More ZBAPI modules

The following describes how to sufficiently set up your SAP instance in order to use the following custom BAPIs:

  • ZBAPI_ADDR_QUERY
  • ZBAPI_QUERY_SAP
  • ZBAPI_CUST_QUERY
  • ZBAPI_CUSTOMER_CD

To create ABAP custom objects, groups, and modules:

  1. Create the same dictionary objects created for the BAPI ZBAPI_CUSTOMER using the following structure/table type:

    retail-2.2-bapi-51.png

    retail-2.2-bapi-52.png

  2. Create the function group ZFG_CUSTOMER2.

  3. Create the function module ZBAPI_ADDR_QUERY using 'Remote-enable module' as the processing type:

    retail-2.2-bapi-53.png

  4. Complete the import parameters with the following:

    retail-2.2-bapi-54.png

  5. Complete the export parameters with the following:

    retail-2.2-bapi-55.png

  6. Copy and paste the code from 'ZBAPI_ADDR_QUERY.txt'.

  7. Create the function module ZBAPI_ADDR_SAP using 'Remote-enable module' as the processing type:

    retail-2.2-bapi-56.png

  8. Complete the import parameters with the following:

    retail-2.2-bapi-57.png

  9. Complete the export parameters with the following:

    retail-2.2-bapi-58.png

  10. Copy and paste the code from 'ZBAPI_QUERY_SAP.txt'.

  11. Create the function module ZBAPI_CUST_QUERY using 'Remote-enable module' as the processing type:

    retail-2.2-bapi-59.png

  12. Complete the import parameters with the following:

    retail-2.2-bapi-60.png

  13. Complete the export parameters with the following:

    retail-2.2-bapi-61.png

  14. Copy and paste the code from 'ZBAPI_CUST_QUERY.txt'.

  15. Create the function module ZBAPI_CUSTOMER_CD using 'Remote-enable module' as the processing type:

    retail-2.2-bapi-62.png

  16. Complete the import parameters with the following:

    retail-2.2-bapi-63.png

  17. Complete the export parameters with the following:

    retail-2.2-bapi-64.png

  18. Copy and paste the code from 'ZBAPI_CUSTOMER_CD.txt'.

  19. Activate the entire function group by right-clicking on it in the tree and selecting 'Activate':

    retail-2.2-bapi-65.png



back to top


Reviews

TypeCustom
OrganizationMulesoft Inc.
Published by
MuleSoft Solutions
Published onJun 28, 2022
Contact nameMuleSoft Solutions
Contact emailsolutions-questions@mulesoft.com
Asset overview

Asset versions for 2.6.x

Asset versions
VersionActions
2.6.0